# -*- coding: utf-8 -*-
"""
 @Time    : 2021/1/29 下午4:33
 @Author  : tgy
 
"""
from abc import ABC,abstractmethod




def my_abstractmethod(func):
    ...
    func.__is_abtractmenthod__ = True
    return func


class MyType(type):
    ...

    def __call__(self, *args, **kwargs):
        ...

        for val in self.__dict__.values():
            ...
            if callable(val) and hasattr(val,'__is_abtractmenthod__') and getattr(val,'__is_abtractmenthod__'):
                ...
                raise TypeError("Can't instantiate abstract class Run with abstract methods %s" % val.__name__)

        return super().__call__(*args,**kwargs)


class MyABC(metaclass=MyType):
    ...


class Run(MyABC):

    # @my_abstractmethod
    def run(self):
        ...
        return '123'

def test():
    ...
    assert True, '报错'

if __name__ == '__main__':
    ...
    test()
    print(test.__name__)
    r = Run()
    print(r.run())
